import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Page1 from "../views/Page1.vue";
import Page2 from "../views/Page2.vue";
import Page3 from "../views/Page3.vue";
const  components={
    Layout: () => import('/@/layout/index.vue'),
    HelloWorld:()=> import('/@/components/HelloWorld.vue'),
    404: () => import('/@/views/ErrorPage/404.vue'),
}

const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "Dashboard",
        component: components.Layout,
    },
    {
        path: "/hello",
        name: "HelloWorld",
        component: components['HelloWorld'],
    },
    {
        path: "/page1",
        name: "Page1",
        component: Page1,
    },
    {
        path: "/page2",
        name: "Page2",
        component: Page2,
    },
    {
        path: "/page3",
        name: "Page3",
        component: Page3,
    },
    {
        path: "/about",
        name: "About",
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import("../components/About.vue")
    }
];
//process.env.BASE_URL
const router = createRouter({
    history: createWebHistory('/'),
    routes,
});

export default router;
